package com.itnoob.command1.example.service;

/**
 * @author zhoujun
 * @date 2025/3/18 23:14
 */
public class StockService {

    /**
     * 获取库存的方法
     * @param productId
     * @return
     * @throws InterruptedException
     */
    public int getStock(int productId) throws InterruptedException {
        int result = 116;
        //模拟网络延迟,休眠2s
        Thread.sleep(2000);
        System.out.println("productId" + productId + ",stock: " + result);
        return  result;
    }
}
